package com.gmail.dengtao.joe.game.server.config;

import org.dom4j.Document;

import com.gmail.dengtao.joe.game.server.utils.XMLUtil;

public class ServerConfig {

	private AcceptorConfig acceptorConfig;
	private GroupConfig groupConfig;

	public ServerConfig(String config) throws Exception {
		Document doc = XMLUtil.parse(this.getClass().getResource("/config/server.xml"));
		acceptorConfig = new AcceptorConfig(doc);
		groupConfig = new GroupConfig(doc);
	}

	public AcceptorConfig getAcceptorConfig() {
		return acceptorConfig;
	}

	public void setAcceptorConfig(AcceptorConfig acceptorConfig) {
		this.acceptorConfig = acceptorConfig;
	}

	public GroupConfig getGroupConfig() {
		return groupConfig;
	}

	public void setGroupConfig(GroupConfig groupConfig) {
		this.groupConfig = groupConfig;
	}

	@Override
	public String toString() {
		return "ServerConfig [acceptorConfig=" + acceptorConfig
				+ ", groupConfig=" + groupConfig + "]";
	}
	
}